package com.baike.service.impl;

import com.baike.entity.TbContentCategory;
import com.baike.mapper.TbContentCategoryMapper;
import com.baike.service.ITbContentCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 内容分类 服务实现类
 * </p>
 *
 * @author x_FG
 * @since 2021-10-30
 */
@Service
public class TbContentCategoryServiceImpl extends ServiceImpl<TbContentCategoryMapper, TbContentCategory> implements ITbContentCategoryService {

    @Autowired
    private TbContentCategoryMapper contentCategoryMapper;

    @Override
    public TbContentCategory getCategoryById(Integer id) {
        return contentCategoryMapper.selectById(id);
    }

    @Override
    public boolean insertCategoryInfo(TbContentCategory tbContentCategory) {
        return contentCategoryMapper.insert(tbContentCategory)>0;
    }

    @Override
    public boolean updateCategoryInfo(TbContentCategory tbContentCategory) {
        return contentCategoryMapper.updateById(tbContentCategory)>0;
    }
}
